﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace PwjCy.Lite.Storage
{
    /// <summary>
    /// 数据库连接
    /// </summary>
    public interface IConnection
    {
        IDbTransaction BeginTransaction();
        IDbTransaction BeginTransaction(IsolationLevel iso);
        void Close();
        IStatement CreateStatement(string sql);
        //IStatement CreateStatement(IPwjCyObject pwjcyObject);
        bool ExistTable(string tableName);
        DataTable GetOleDbSchemaTable(Guid schema, object[] restrictions);
        string GetParameterPlaceHolder(string key);
        DataTable GetSchemaTables(string catalog, string schema, string name, string type);
        void Open();
        ICallableStatement PrpareCall(string sql);
        IPreparedStatement PrepareStatement(string sql);
        void ReOpen();
        object InnerConnection { get; }
        ConnectionState State { get; }
        IStorageContext StorageContext { get; }
    }
}
